package com.ruoyi.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 病情信息表
 * @TableName disease_info
 */
@TableName(value ="disease_info")
@Data
public class DiseaseInfo implements Serializable {
    /**
     * 病情信息唯一标识，主键，不可为空
     */
    @Excel(name = "病情信息唯一标识", prompt = "病情信息唯一标识")
    @TableId(value = "disease_id", type = IdType.AUTO)
    private Long diseaseId;

    /**
     * 用户唯一标识，外键，与UserInfo表的UserID关联
     */
    @Excel(name = "用户唯一标识", prompt = "用户唯一标识")
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 病种类别，如"1.新冠肺炎"、"2.普通型肺炎"等
     */
    @Excel(name = "病种类别", prompt = "病种类别")
    @TableField(value = "disease_type")
    private String diseaseType;

    /**
     * 病阶段，如1"轻型"、2"重型"、3“危重型”等
     */
    @Excel(name = "病阶段", prompt = "病阶段")
    @TableField(value = "disease_stage")
    private String diseaseStage;

    /**
     * 诊断日期，日期格式
     */
    @Excel(name = "诊断日期", prompt = "诊断日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(value = "diagnosis_date")
    private String diagnosisDate;

    /**
     * 症状描述
     */
    @Excel(name = "症状描述", prompt = "症状描述")
    @TableField(value = "symptoms")
    private String symptoms;

    /**
     * 创建时间
     */
    @Excel(name = "创建时间", prompt = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)//创建与修改时自动填充
    private Date createTime;

    /**
     * 更新新时间
     */
    @Excel(name = "更新新时间", prompt = "更新新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)//创建与修改时自动填充
    private Date updateTime;

    /**
     * 逻辑删除1删除0正常
     */
    @TableField(value = "is_delete")
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DiseaseInfo other = (DiseaseInfo) that;
        return (this.getDiseaseId() == null ? other.getDiseaseId() == null : this.getDiseaseId().equals(other.getDiseaseId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getDiseaseType() == null ? other.getDiseaseType() == null : this.getDiseaseType().equals(other.getDiseaseType()))
            && (this.getDiseaseStage() == null ? other.getDiseaseStage() == null : this.getDiseaseStage().equals(other.getDiseaseStage()))
            && (this.getDiagnosisDate() == null ? other.getDiagnosisDate() == null : this.getDiagnosisDate().equals(other.getDiagnosisDate()))
            && (this.getSymptoms() == null ? other.getSymptoms() == null : this.getSymptoms().equals(other.getSymptoms()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDiseaseId() == null) ? 0 : getDiseaseId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getDiseaseType() == null) ? 0 : getDiseaseType().hashCode());
        result = prime * result + ((getDiseaseStage() == null) ? 0 : getDiseaseStage().hashCode());
        result = prime * result + ((getDiagnosisDate() == null) ? 0 : getDiagnosisDate().hashCode());
        result = prime * result + ((getSymptoms() == null) ? 0 : getSymptoms().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", diseaseId=").append(diseaseId);
        sb.append(", userId=").append(userId);
        sb.append(", diseaseType=").append(diseaseType);
        sb.append(", diseaseStage=").append(diseaseStage);
        sb.append(", diagnosisDate=").append(diagnosisDate);
        sb.append(", symptoms=").append(symptoms);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
